package com.dong.pattern.chain;

public class Client {

    public static void main(String[] args) {
        Handler handlerA  = new Handler() {
            @Override
            protected void handleProcess() {
                System.out.println("handler a ...");
            }
        };
        Handler handlerB = new Handler() {
            @Override
            protected void handleProcess() {
                System.out.println(" handler   b .... ");
            }
        };
        Handler handlerC = new Handler() {
            @Override
            protected void handleProcess() {
                System.out.println(" handler   c .... ");
            }
        };
        handlerA.setSuccesor(handlerB);
        handlerB.setSuccesor(handlerC);
        handlerA.execute();
    }
}
